/**
 * @Time    : 2022/03/09 15:19
 * @Author  : WanRongJia
 * @License : Software business license
 * @Site    : www.linshensjl.top
 * @File    : searchUser.js
 * @Software: Rich Web Platform
 * @Function: 注册用户
 * @Version : 1.0
 **/
const {matchedData} = require('express-validator')
const {registerUser} = require('./helpers/regiterUser')
const {buildResponse} = require('../../utils/buildResponse')
const register = async function (req, res) {
    try {
        req = matchedData(req)
        let userInfo = await registerUser(req)
        res.json(buildResponse(userInfo,'注册成功',true))
    } catch (e) {
        res.json(e)
    }
}

module.exports = {register}